package com.skytech.tax.customsdatawarehouse.singlewindow.processtrade.books.domain.entity;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.skytech.tax.customsdatawarehouse.singlewindow.revokelist.domain.entity.RevokeListSimple;

import java.awt.print.Book;

/**
 * @author Lianhong
 * @since 2021/11/11
 */
public class Books {

    private String seqNo;

    private String books;

    private String socialCreditCode;
    private String inputtime;
    private String storageTime;

    public String getSeqNo() {
        return seqNo;
    }

    public void setSeqNo(String seqNo) {
        this.seqNo = seqNo;
    }

    public String getBooks() {
        return books;
    }

    public void setBooks(String books) {
        this.books = books;
    }

    public String getSocialCreditCode() {
        return socialCreditCode;
    }

    public void setSocialCreditCode(String socialCreditCode) {
        this.socialCreditCode = socialCreditCode;
    }

    public String getInputtime() {
        return inputtime;
    }

    public void setInputtime(String inputtime) {
        this.inputtime = inputtime;
    }

    public String getStorageTime() {
        return storageTime;
    }

    public void setStorageTime(String storageTime) {
        this.storageTime = storageTime;
    }

    public BooksSimple buildBooksSimple() {
        BooksSimple simple = new BooksSimple();
        simple.setSeqNo(seqNo);
        return simple;
    }

    public void addFields() {
        JSONObject books = JSON.parseObject(this.books);
        JSONObject nemsHead = books.getJSONObject("nemsHead");
        this.inputtime = nemsHead.getString("inputtime");
    }
}
